<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      margin: 0;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #33655b;
    }

    .battery {
      font-size: 30px;
      width: 6em;
      height: 3em;
      color: white;
      border: 0.5em solid;
      border-radius: 0.2em;
      position: relative;
      background-image: linear-gradient(to right, orange, orange);
      background-repeat: no-repeat;
      background-size: 10% 80%;
      background-position: 0.3em 0.3em;
      filter: opacity(0.8);
      animation: toRight 2s linear infinite;
    }

    .battery::after {
      content: "";
      position: absolute;
      width: 0.5em;
      height: 2em;
      background-color: currentColor;
      top: 0.5em;
      right: -1em;
      border-radius: 0 0.2em 0.2em 0;
    }

    @keyframes toRight {
      to {
        background-size: 90% 80%;
      }
    }
  </style>
</head>
<body>
  <div class="battery"></div>
</body>
</html>